home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Collection of Tools & Utilities
/
Collection of Tools and Utilities.iso
/
comm
/
tskerm25.zip
/
GETTEXT.CMD
< prev
next >
Wrap
OS/2 REXX Batch file
|
1994-02-09
|
2KB
|
52 lines
;
; GETTEXT.CMD by Prof. Timo Salmi, ts@uwasa.fi, Wed 9-Feb-94
; A script to get a text file from a Unix host to your PC
;
; To run gettext.cmd script give kermit command:
; take gettext.cmd [filename]
; Or if you have run take zset.cmd then just give kermit command:
; gettext [filename]
;
; Error handling:
def errstop echo \%1\7\13, define \%1, stop
if not defined \%1 ask \%f Get which textfile?
if defined \%1 define \%f \%1
if not defined \%f errstop {Error: You have not defined the filename variable}
;
set take-echo on ;Show what is happening
clear ;Clear the input buffer
set parity none ;CHANGE as your system might require
set receive packet 1024 ;Use long packets
set file type text ;This is a text transfer
set take-echo off ;Enough of displaying the comments
;
pause 1 ;Let's not be too hasty about it :-)
output kermit\13 ;Invoke Unix C-kermit
pause 1
output set file type text\13 ;Ordinary ascii text file
pause 1
output set parity none\13 ;CHANGE as your system might require
pause 1
output set send packet 1024\13 ;Use long packets (C-Kermit)
pause 1
output send \%f\13 ;Start sending the file from host
pause 1
;
input 5 ?File not found ;Check that host has the file
if fail goto label1
echo \13Host reported an error\7\7\7\7\7\13
echo \13
goto label2 ;Don't try to receive
;
:LABEL1
receive r:\ ;Where to put the file in your PC
; ; change the path as applicable
:LABEL2
pause 5 ;A longer pause is required here
output quit\13 ;Quit host kermit
pause 1
define \%f ;Release filename
define \%1 ;Release parameter
pause 1
echo \13Script GETTEXT.CMD by Prof. Timo Salmi, Done